package com.youku.utils
{
   import flash.display.Sprite;
   import flash.text.TextField;
   
   public class ScreenOutput extends Sprite
   {
      
      public function ScreenOutput() {
         super();
         _background = DrawUtil.RectangleSprite(0,0,400,300,16777215,0.5,null,0);
         _textfield = new TextField();
         _textfield.width = 400;
         _textfield.height = 300;
         _textfield.wordWrap = true;
         _textfield.multiline = true;
         addChild(_background);
         addChild(_textfield);
      }
      
      private static var _instance:ScreenOutput;
      
      private static var _background:Sprite;
      
      private static var _textfield:TextField;
      
      public static function get instance() : ScreenOutput {
         if(_instance)
         {
            return _instance;
         }
         _instance = new ScreenOutput();
         return _instance;
      }
      
      public static function log(param1:String) : void {
         if(instance == null)
         {
            return;
         }
         _textfield.text = param1 + "\n" + _textfield.text;
      }
   }
}
